package com.cssw.fyzb.wap.controller;

import com.cssw.fyzb.base.web.domain.AjaxData;
import com.cssw.fyzb.wap.model.vo.ParamVo;
import com.cssw.fyzb.wap.service.CommonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * @Auther: yangyiqun
 * @Date: 2020/12/15 11:50
 * @Description:
 */
@Api(description = "公共查询相关接口")
@RequestMapping("/common")
@Controller
public class CommonController {

    private static final Logger logger = LoggerFactory.getLogger(CommonController.class);

    @Autowired
    private CommonService commonService;

    @ApiOperation(value = "查询配置参数")
    @RequestMapping(value = "/getParam", method = RequestMethod.GET)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "code", value = "参数编码", paramType = "query", dataType = "string", required = true)
    })
    @ResponseBody
    public AjaxData<ParamVo> getParam(String code) {
        return commonService.getParam(code);
    }


    @ApiOperation(value = "查询开通vip直播金额")
    @RequestMapping(value = "/getOpenVipAnchorAmount", method = RequestMethod.GET)
    @ResponseBody
    public AjaxData<ParamVo> getOpenVipAnchorAmount() {
        return commonService.getParam("OPEN_VIP_ANCHOR_AMOUNT");
    }
}
